﻿using HalconDotNet;
using learn_halcon_01.Properties;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Resources;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace learn_halcon_01
{
   
    public partial class Form1 : Form
    {
        HObjectAndImageConverter converter = new HObjectAndImageConverter();
        public Form1()
        {
            InitializeComponent();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));

            this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));

            ReadImage readImage = new ReadImage();
            HObject hobject = readImage.action();

            Bitmap bimp = null;
            converter.HObject2Bpp24(hobject, out bimp);

            this.pictureBox1.Image = ((System.Drawing.Image)bimp);

        }

    }
}
